<template>
  <div class="div" ref="div">
    
  </div>
</template>

<script setup>
import * as echarts from 'echarts'
import {onMounted,ref,reactive} from 'vue'
import {getsalary} from '../../request/index'

const option=reactive(
    {
         backgroundColor:null,
    color:null,
    tooltip:null,
    legend:null,
    series:null
})
const div=ref()
let myChart 
onMounted(()=>{
        getsalary().then(res=>{
             console.log('毕业薪资数据',res);
     myChart=echarts.init(div.value)
    option.backgroundColor=res.data.data.backgroundColor
    option.color=res.data.data.color
    option.legend=res.data.data.legend
    option.tooltip=res.data.data.tooltip
    option.series=res.data.data.series
    myChart.setOption(option)
        })
  


})
  window.addEventListener('resize', function() {
    myChart.resize();
  });


</script>

<style scoped>
.div{
    width: 99%;
    height: 90%;
}
</style>